<?php

/**
 * PasswordAnswer form base class.
 *
 * @method PasswordAnswer getObject() Returns the current form's model object
 *
 * @package    myarticles
 * @subpackage form
 * @author     Apul Gupta<apulmca2k4@gmail.com>
 */
abstract class BasePasswordAnswerForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'question_id' => new sfWidgetFormPropelChoice(array('model' => 'PasswordQuestion', 'add_empty' => true)),
      'answer'      => new sfWidgetFormInputText(),
      'user_id'     => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => true)),
      'created_at'  => new sfWidgetFormDateTime(),
      'updated_at'  => new sfWidgetFormDateTime(),
      'is_active'   => new sfWidgetFormInputCheckbox(),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'PasswordAnswer', 'column' => 'id', 'required' => false)),
      'question_id' => new sfValidatorPropelChoice(array('model' => 'PasswordQuestion', 'column' => 'id', 'required' => false)),
      'answer'      => new sfValidatorString(array('max_length' => 200)),
      'user_id'     => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id', 'required' => false)),
      'created_at'  => new sfValidatorDateTime(array('required' => false)),
      'updated_at'  => new sfValidatorDateTime(array('required' => false)),
      'is_active'   => new sfValidatorBoolean(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('password_answer[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'PasswordAnswer';
  }


}
